Skip to content

[Perf] Add opt-in DFlash2 schedules and numerical audits - #556

Merged
yangzhuxinyzx merged 40 commits into
mainfrom
codex/v100-quasar-dflash2-15ms-20260907-161715
Sep 9, 2026
Merged

yangzhuxinyzx merged 40 commits into
mainfrom
codex/v100-quasar-dflash2-15ms-20260907-161715

Conversation

@yangzhuxinyzx

@yangzhuxinyzx yangzhuxinyzx commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Purpose

DFlash2 TP4/B1/q8 verification spends substantial time in projection, state layout, attention and scheduling. This change adds independently selectable schedules and reproducible operator/model audits for the current approximately 16-ms complete-round path. The common installer selects GDN BV2, context/probe scheduling, grouped E4M3 attention and sparse selection through actual tensor/shape guards, independently of target quantization names. A separate hashed QPN2 manifest selects NVFP4 cap64 projections and TP4 publication. Unsupported shapes retain their existing operators.

The PR also contains the grouped-attention warp synchronization repair and reuses dependency #563's singleton-prefill metadata fix. It extends existing PR #556 rather than creating duplicate optimization or prefill-fix PRs. No experimental route is enabled by default; source integration does not certify unfinished runtime admission. Sub-15-ms complete rounds have not been achieved.

Test Plan

Freeze source, native libraries, model weights, sampling and physical GPUs 4–7. Preserve TP4/B1/q8, E4M3 target KV, FP32 logits/state, FP16 draft transport, T1/k20/p.95/xhigh and natural EOS. CUDA 12.8, Torch 2.10.0+cu128 and Python 3.12.13 are pinned. The server has --max-model-len 262144; each natural request uses max_tokens=262144-actual_prompt_tokens verified with the server tokenizer. Input is not truncated. One-token warmups and bounded operator diagnostics are excluded from natural-generation scoring.

The frozen corpus contains 148 prompts: 32 each GSM8K, MATH500, HumanEval and MBPP, 16 LiveCodeBench v6 and four JSON/tool cases, with seeds 0/1/2. Independent startups use five warmups and five measured requests per speed fixture/arm. Whole-stack all-off controls, all-layer repeatability, public-entry parity, FP8 and long-prefix boundaries are separate gates. These are dataset subsets, not full-dataset benchmark claims.

Test Result

  • QPN2 publication/cap64, sparse gathering and grouped-attention operator/graph checks pass with byte-equal outputs. Individual fixed-prefix comparisons retain 144 records per arm with native-logit TV=0 and no support/top-1 changes. Their recurrent-state coverage is layers 0/1, not the queued all-layer final-combination audit.
  • GDN BV2 passes all 48 layers on all four ranks with at least 2230 live shadow calls per layer and zero output/state bit differences. Eight selectors, strided pools, graph input changes, padding/retired slots, memcheck and racecheck pass. Context/probe scheduling retains its CPU numerical guard and passes at least 1280 live shadow comparisons per rank.
  • The first new 256K-capacity speed startup measures request-average complete-round medians of 16.571456 → 16.339483 ms for release1k and 16.144814 → 15.907431 ms for MBPP28. Candidate pure decode medians are 182.259 / 306.098 token/s. Tokens, natural EOS and acceptance match. This A/B isolates BV8/BV2 inside the otherwise shared candidate stack; it is not the whole-stack comparison.
  • The historical 16K-output-cap seed-zero campaign completes 148/148 exact incremental pairs. Both arms score GSM8K 30/32, MATH500 31/32, HumanEval base 31/32 and enhanced 30/32, MBPP original assertions 32/32 and eligible EvalPlus enhanced 29/31, LiveCodeBench 11/16, and structured fixtures 4/4. Six capped generations lack final code. These historical scores do not admit the new capacity protocol. Twelve bounded whole-stack controls also match exactly.
  • The new capacity campaign has completed five formerly capped long-output pairs at 21162, 76955, 34520, 70725 and 52704 tokens, all natural stops with identical tokens/acceptance/finish/tool semantics between BV8/BV2. Executable scoring and the complete new campaign remain pending. LiveCodeBench/21 averages 26.916502 ms/round and 122.378 token/s; short-context 16-ms results are not a long-context speed claim.
  • The LiveCodeBench scorer now rejects negative error sentinels using pinned official result > 0 semantics; eight boundary checks pass. Original assertions and EvalPlus eligible subsets have separate denominators.
  • Dependency [Bugfix][Core] Preserve singleton prefill semantics in speculative GDN #563 passes 32 focused CPU metadata tests. Singleton/history-reuse GPU checks remain queued. Latest focused command: CUDA_VISIBLE_DEVICES='' .venv/bin/python -m pytest tests/v1/attention/test_gdn_metadata_builder.py --confcutdir=tests/v1/attention -q -k 'singleton_prefill or gdn_build_classification or common_gdn_metadata_matches or mixed_decode_stays_decode_fastpath or full_cuda_graph_decode_padding_uses_pad_slot' (32 passed, 30 deselected).
  • Scoped route/document pre-commit checks pass. The final documentation update passes pre-commit run --files docs/design/sm70_dflash2_acceptance_20260909.md. Rejected arithmetic or slower scheduling experiments remain disabled and documented.

Integration and remaining validation

Main base b6d91d61ff030fe325dc69eb8372a5c72d0374bd is already included. The running evaluation checkout remains frozen at a7cc5ae305149d7a9ffdf42fb224dff34e5606aa; integration and documentation work do not change its source or native libraries. Reproduction commands, hashes, numerical evidence, long-generation observations and artifact locations are retained in docs/design/sm70_dflash2_acceptance_20260909.md, docs/design/sm70_quasar_dflash2_15ms.md and docs/design/sm70_quasar_dflash2_resource_audit_20260909.md.

This integration preserves opt-in selection. Complete 256K-capacity multi-seed scoring, independent starts, whole-stack quality/acceptance, all-layer repeatability, public-installer parity, real FP8 and long-prefix validation remain open before any default promotion. The previous 4.33% repeat-start TV discrepancy is not an allowed error margin. No serving API, weights, model format, sampling semantics or context capacity is changed by integration.

AI assistance was used for implementation, diagnostics and reporting.

Assisted-by: Codex

…al audits

Record accepted-slot provenance and reject incomplete four-rank comparisons. Localize the observed A/A drift to autotuned first-layer Gemma RMSNorm reduction order.

Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Pin reduction extent and warp count for FP16 input and residual norms. Preserve masked-square and FP32 residual materialization boundaries to match the recorded 8192-element Inductor path.

Keep disabled pending natural-output and complete-round promotion gates. Assisted-by: Codex

Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
@yangzhuxinyzx yangzhuxinyzx changed the title [Bugfix] Audit DFlash2 prefill state and localize autotuned norm drift [Bugfix] Stabilize DFlash2 Gemma reductions and audit prefill state Sep 8, 2026
Read the Qwen3.5 projection row stride directly and retain FP32 beta. Require per-forward route evidence and add real-state replay and runtime-bridge parity coverage.

Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
@yangzhuxinyzx yangzhuxinyzx changed the title [Bugfix] Stabilize DFlash2 Gemma reductions and audit prefill state [Kernel] Stabilize DFlash2 numerics and enable strided q8 GDN verification Sep 8, 2026
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
@yangzhuxinyzx yangzhuxinyzx changed the title [Kernel] Stabilize DFlash2 numerics and enable strided q8 GDN verification [Kernel] Preserve DFlash2 numerics and remove TP4 q8 GDN copies Sep 8, 2026
yangzhuxinyzx and others added 4 commits September 8, 2026 14:11
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Honor explicit prefill metadata in the no-active-spec GDN branch so a
one-token initial prefill does not consume recycled conv/SSM state.
Preserve real decode, legacy no-flag, and non-speculative behavior.

Add CPU regressions for singleton routing, cached initial-state flags,
graph metadata settings, and recycled finite/NaN convolution state.

Related: vllm-project/vllm#51565 (narrow 1Cat fork adaptation).

Signed-off-by: Zhaochengggg <87113558+zhaochengggg@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
@yangzhuxinyzx yangzhuxinyzx changed the title [Kernel] Preserve DFlash2 numerics and remove TP4 q8 GDN copies [Perf] Gate DFlash2 layout and QPN2 verification optimizations Sep 8, 2026
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Add the warp memory barrier before online-softmax state publication and retain a short q8 racecheck fixture. Record the native kernel, fixed-prefix, and complete-round candidate results without enabling unadmitted routes.

Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Preserve the repaired per-head arithmetic while building one-group and three-group private candidates with complete source manifests. Record the rebuilt numerical gate and the bounded QPN2 scheduling experiments.

Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Record the actual four-rank fixed-prefix attention gate and unprofiled pair. Add isolated two-channel publication experiments; both serialized and overlapped chunks regress and remain disabled.

Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Add an explicit experimental installer that preserves the CPU predicate and defers cache commit. Record four-rank natural shadow parity and qualify the first timing pair. Add the actual-weight FP16 layout error screen and retain rejected broad variants.

Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Retain post-reboot context overlap proof and the rejected QPN2 and native FlashInfer fragment screens. Keep changed draft trajectories unadmitted and gate the GDN schedule to captured TP4 q8 with FP32 state.

Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
…ash2-15ms-20260907-161715

Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
…flash2-15ms-20260907-161715

Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
@yangzhuxinyzx yangzhuxinyzx changed the title [Perf] Gate DFlash2 layout and QPN2 verification optimizations [Perf] Validate DFlash2 schedules independently of target quantization Sep 9, 2026
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
@yangzhuxinyzx yangzhuxinyzx changed the title [Perf] Validate DFlash2 schedules independently of target quantization [Perf] Add opt-in DFlash2 schedules and numerical audits Sep 9, 2026
@yangzhuxinyzx
yangzhuxinyzx marked this pull request as ready for review September 9, 2026 12:50
Assisted-by: Codex
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
@yangzhuxinyzx
yangzhuxinyzx merged commit 3314319 into main Sep 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants